////////////////////////////////////////////////
// DESCRIPTION:
//    GPIO Pin definitions for the iMXS CPU
//
// Legal Notices:
//   Copyright (c) 2008, Telliam Consulting, LLC.
//   All rights reserved.
//
//   Redistribution and use in source and binary forms, with or without modification,
//   are permitted provided that the following conditions are met:
//
//   * Redistributions of source code must retain the above copyright notice, this list
//     of conditions and the following disclaimer.
//   * Redistributions in binary form must reproduce the above copyright notice, this
//     list of conditions and the following disclaimer in the documentation and/or other
//     materials provided with the distribution.
//   * Neither the name of Telliam Consulting nor the names of its contributors may be
//     used to endorse or promote products derived from this software without specific
//     prior written permission.
//
//   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
//   EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
//   OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
//   SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
//   INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
//   TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 
//   BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
//   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
//   ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
//   DAMAGE. 
//
using System;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;

namespace FusionWare.SPOT.Hardware.iMXS
{
    /// <summary>Defined constants for fixed in hardware GPIO pins</summary>
    /// <remarks>
    /// This class provides constants that symbolicly name the GPIO pins defined
    /// in the hardware for the iMXS CPU. 
    /// 
    /// It is important to use the symbolic enumerations here instead of hard
    /// coding the Cpu.Pin values as it makes things clearer and isolates the
    /// application from differences in the physical hardware (and the emulator)
    /// over time. 
    /// </remarks>
    public static class Pins
    {
        /// <summary>Timer Input or GPIO</summary>
        public const Cpu.Pin TIN = (Cpu.Pin)1;
        /// <summary>PWM Output or GPIO</summary>
        public const Cpu.Pin PWM = (Cpu.Pin)2;
        /// <summary>I2C Bus SDA Line</summary>
        public const Cpu.Pin I2C_SDA = (Cpu.Pin)15;
        /// <summary>I2C Bus SCL Line</summary>
        public const Cpu.Pin I2C_SCL = (Cpu.Pin)16;
        /// <summary>UART2 (COM2) Clear To Send</summary>
        public const Cpu.Pin UART2_CTS = (Cpu.Pin)60;
        /// <summary>UART2 (COM2) Request To Send</summary>
        public const Cpu.Pin UART2_RTS = (Cpu.Pin)61;
        /// <summary>UART2 Transmit</summary>
        public const Cpu.Pin UART2_TXD = (Cpu.Pin)62;
        /// <summary>UART2 Receive</summary>
        public const Cpu.Pin UART2_RXD = (Cpu.Pin)63;
        /// <summary>SSI Receive Frame Synch</summary>
        public const Cpu.Pin SSI_RXFS = (Cpu.Pin)67;
        /// <summary>SSI Receive Clock</summary>
        public const Cpu.Pin SSI_RXCLK = (Cpu.Pin)68;
        /// <summary>SSI Receive Data</summary>
        public const Cpu.Pin SSI_RXDAT = (Cpu.Pin)69;
        /// <summary>SSI Transmit Data</summary>
        public const Cpu.Pin SSI_TXDAT = (Cpu.Pin)70;
        /// <summary>SSI Transmit Frame Synch</summary>
        public const Cpu.Pin SSI_TXFS = (Cpu.Pin)71;
        /// <summary>SSI Transmit Clock</summary>
        public const Cpu.Pin SSI_TXCLK = (Cpu.Pin)72;
        /// <summary>UART1 (COM1) Clear To Send</summary>
        public const Cpu.Pin UART1_CTS = (Cpu.Pin)73;
        /// <summary>UART1 (COM1) Request To Send</summary>
        public const Cpu.Pin UART1_RTS = (Cpu.Pin)74;
        /// <summary>UART1 (COM1) Transmit Data</summary>
        public const Cpu.Pin UART1_TXD = (Cpu.Pin)75;
        /// <summary>UART1 (COM1) Receive Data</summary>
        public const Cpu.Pin UART1_RXD = (Cpu.Pin)76;
        /// <summary>SPI Bus Ready</summary>
        public const Cpu.Pin SPI_RDY = (Cpu.Pin)77;
        /// <summary>SPI Bus Clock</summary>
        public const Cpu.Pin SPI_SCLK = (Cpu.Pin)78;
        /// <summary>SPI Bus SLave Select</summary>
        public const Cpu.Pin SPI_SS = (Cpu.Pin)79;
        /// <summary>SPI Bus Master-In/Slave-Out</summary>
        public const Cpu.Pin SPI_MISO = (Cpu.Pin)80;
        /// <summary>SPI Bus Master-Out/Slave-In</summary>
        public const Cpu.Pin SPI_MOSI = (Cpu.Pin)81;
        /// <summary>LCD Shift Clock</summary>
        public const Cpu.Pin LSCLK = (Cpu.Pin)102;
        /// <summary>LCD Reverse scan</summary>
        public const Cpu.Pin REV = (Cpu.Pin)103;
        /// <summary>LCD Start signal output for gate driver #</summary>
        public const Cpu.Pin CLS = (Cpu.Pin)104;
        /// <summary>LCD Control signal output for source driver #</summary>
        public const Cpu.Pin PS = (Cpu.Pin)105;
        /// <summary>LCD Program horizontal scan direction #</summary>
        public const Cpu.Pin SPL_SPR = (Cpu.Pin)106;
        /// <summary>LCD bias voltage control</summary>
        public const Cpu.Pin CONTRAST = (Cpu.Pin)107;
        /// <summary>LCD Alternate crystal direction / output enable</summary>
        public const Cpu.Pin ACD_OE = (Cpu.Pin)108;
        /// <summary>LCD Line pulse or horizontal sync</summary>
        public const Cpu.Pin HSYNC = (Cpu.Pin)109;
        /// <summary>LCD Line pulse or vertical sync</summary>
        public const Cpu.Pin VSYNC = (Cpu.Pin)110;
        /// <summary>LCD Data Line 0</summary>
        public const Cpu.Pin LCDD0 = (Cpu.Pin)111;
        /// <summary>LCD Data Line 1</summary>
        public const Cpu.Pin LCDD1 = (Cpu.Pin)112;
        /// <summary>LCD Data Line 2</summary>
        public const Cpu.Pin LCDD2 = (Cpu.Pin)113;
        /// <summary>LCD Data Line 3</summary>
        public const Cpu.Pin LCDD3 = (Cpu.Pin)114;
        /// <summary>LCD Data Line 4</summary>
        public const Cpu.Pin LCDD4 = (Cpu.Pin)115;
        /// <summary>LCD Data Line 5</summary>
        public const Cpu.Pin LCDD5 = (Cpu.Pin)116;
        /// <summary>LCD Data Line 6</summary>
        public const Cpu.Pin LCDD6 = (Cpu.Pin)117;
        /// <summary>LCD Data Line 7</summary>
        public const Cpu.Pin LCDD7 = (Cpu.Pin)118;
        /// <summary>LCD Data Line 8</summary>
        public const Cpu.Pin LCDD8 = (Cpu.Pin)119;
        /// <summary>LCD Data Line 9</summary>
        public const Cpu.Pin LCDD9 = (Cpu.Pin)120;
        /// <summary>LCD Data Line 10</summary>
        public const Cpu.Pin LCDD10 = (Cpu.Pin)121;
        /// <summary>LCD Data Line 11</summary>
        public const Cpu.Pin LCDD11 = (Cpu.Pin)122;
        /// <summary>LCD Data Line 12</summary>
        public const Cpu.Pin LCDD12 = (Cpu.Pin)123;
        /// <summary>LCD Data Line 13</summary>
        public const Cpu.Pin LCDD13 = (Cpu.Pin)124;
        /// <summary>LCD Data Line 14</summary>
        public const Cpu.Pin LCDD14 = (Cpu.Pin)125;
        /// <summary>LCD Data Line 15</summary>
        public const Cpu.Pin LCDD15 = (Cpu.Pin)126;
        /// <summary>Timer2 Output</summary>
        public const Cpu.Pin TMR2OUT = (Cpu.Pin)127;
    }
}
